package br.com.sadim.dao;

import java.util.List;

import br.com.sadim.hospital.Exame;

import org.hibernate.Session;

public class ExameDAOHibernate implements ExameDAO {
	
	private Session session;
	public void setSession(Session s) {
		session = s;
	}

	@Override
	public void save(Exame user) {
		session.save(user);
	}

	@Override
	public void delete(Exame user) {
		session.delete(user);
	}

	@Override
	public void update(Exame user) {
		session.update(user);
	}

	@Override
	public Exame getById(Integer idExame) {
		return (Exame) session.get(Exame.class, idExame);
	}


	@SuppressWarnings("unchecked")
	@Override
	public List<Exame> getList() {
		return session.createCriteria(Exame.class).list();
	}


}
